import pygame
import sys

from utils.angle_to_arc import angle_to_arc

pygame.init()

WINX = 300
WINY = 300
screen = pygame.display.set_mode((WINX, WINY))
fclock = pygame.time.Clock()
x = 100
y = 100
speedx = 5
speedy = 5
while True:
    for e in pygame.event.get():
        if e.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
    screen.fill((0, 0, 0))
    pygame.draw.circle(screen, (255, 255, 255), (222, 100), 50)
    pygame.draw.line(screen, (0, 255, 255), (5, 50), (205, 205), 1)
    pygame.draw.aaline(screen, (0, 255, 255), (2, 2), (200, 200), 10)
    angle1 = angle_to_arc(0)
    angle2 = angle_to_arc(359)
    pygame.draw.arc(screen, (255, 0, 0), (50, 100, 200, 200), angle1, angle2, 5)

    pygame.draw.rect(screen, (62, 134, 160), (x, y, 90, 90))
    if x >= WINX:
        x = 0 - 90
    # x+=speedx
    # x+=speedx
    # if y >= WINY - 90 or y<=0:
    #     #     speedy *= -1

    x += speedx
    # y+=speedy
    pygame.display.update()
    fclock.tick(25)
